//
//  BoxCostHeadView.m
//  XLDoctor
//
//  Created by longma on 2018/10/8.
//  Copyright © 2018年 XLH. All rights reserved.
//

#import "MJUICellImageTextView.h"

@implementation MJUICellImageTextView


- (void)awakeFromNib{
    [super  awakeFromNib];
    
    self.leftImageView.hidden = true;
    if(self.iconName){
        self.leftImageView.image = MJUIImageMake(self.iconName);
        self.leftImageView.hidden = false;
    }
    if(self.title){
        self.titleLabel.mj_localizable = self.title;
    }
    if(self.subTitle){
        self.subTitleTextField.text = self.subTitle;
    }
    if(self.hideLine){
        self.horLine.hidden = self.hideLine;
    }
    if(self.hideRightImageView){
        self.rightImageView.hidden = self.hideRightImageView;
    }
    if(self.subTitleColorName){
        self.subTitleTextField.textColor = [UIColor mj_colorName:self.subTitleColorName];
    }
    
    self.backgroundColor = UIColor.clearColor;
    
    if(self.itemType == 1){
        self.leftImageViewW.constant = 30;
        self.leftImageViewH.constant = 30;
    }
}

- (void)setSubTitle:(NSString *)subTitle {
    self.subTitleTextField.hidden = false;
    self.subTitleTextField.text = subTitle;
}

- (void)setSubTitlePlaceholder:(NSString *)subTitlePlaceholder {
    self.subTitleTextField.hidden = false;
    self.subTitleTextField.mj_pLocalizable = subTitlePlaceholder;
}

- (void)layoutSubviews{
    [super layoutSubviews];
     
}

@end
